import 'package:finance_app/src/entities/Summary.dart';
import 'package:finance_app/src/entities/account_receivables_payables_entity.dart';

class AccountReceivablesPayablesListEntity {
  List<AccountReceivablesPayablesEntity> dataMapped;
  String default_currency_code;
  Summary summary;

  AccountReceivablesPayablesListEntity({this.dataMapped, this.default_currency_code, this.summary});

  factory AccountReceivablesPayablesListEntity.fromJson(Map<String, dynamic> json) {
    return AccountReceivablesPayablesListEntity(
      dataMapped: json['dataMapped'] != null ? (json['dataMapped'] as List).map((i) => AccountReceivablesPayablesEntity.fromJson(i)).toList() : null,
      default_currency_code: json['default_currency_code'],
      summary: json['summary'] != null ? Summary.fromJson(json['summary']) : null,
    );
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['default_currency_code'] = this.default_currency_code;
    if (this.dataMapped != null) {
      data['dataMapped'] = this.dataMapped.map((v) => v.toJson()).toList();
    }
    if (this.summary != null) {
      data['summary'] = this.summary.toJson();
    }
    return data;
  }
}
